package com.jinke.api.modules.app.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.jinke.api.modules.base.model.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 自定义价格表
 * </p>
 *
 * @author
 * @since 2024-07-17
 */
@Getter
@Setter
@TableName("price_rule")
@ApiModel(value = "PriceRule对象", description = "自定义价格表")
public class PriceRule extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;


    @ApiModelProperty("渠道ID")
    private Long channelId;

    @ApiModelProperty("货运商运输服务code")
    private String serviceCode;

    @ApiModelProperty("渠道平台id")
    private Long channelPlatformId;

    @ApiModelProperty("本档起点，单位磅,不超过起点按此档算重加价")
    private Integer poundsLine;

    @ApiModelProperty("本档起点，单位oz,不超过起点按此档算重加价")
    private Integer ozLine;

    @ApiModelProperty("对应区的重量加价")
    private BigDecimal zone1;

    @ApiModelProperty("对应区的重量加价")
    private BigDecimal zone2;

    @ApiModelProperty("对应区的重量加价")
    private BigDecimal zone3;

    @ApiModelProperty("对应区的重量加价")
    private BigDecimal zone4;

    @ApiModelProperty("对应区的重量加价")
    private BigDecimal zone5;

    @ApiModelProperty("对应区的重量加价")
    private BigDecimal zone6;

    @ApiModelProperty("对应区的重量加价")
    private BigDecimal zone7;

    @ApiModelProperty("对应区的重量加价")
    private BigDecimal zone8;

    @ApiModelProperty("对应区的重量加价")
    private BigDecimal zone9;

    public  BigDecimal getZoneValue(int zoneNumber) {
        switch (zoneNumber) {
            case 1: return zone1;
            case 2: return zone2;
            case 3: return zone3;
            case 4: return zone4;
            case 5: return zone5;
            case 6: return zone6;
            case 7: return zone7;
            case 8: return zone8;
            case 9: return zone9;
            default: throw new IllegalArgumentException("无效的 zone 编号: " + zoneNumber);
        }
    }


}
